<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>
<script>
  const obj1 = {
    name: '枫可怜',
    age: 40,
  };

  // Object.defineProperty给对象去添加或者修改某个属性，并且可以给属性设置描述
  Object.defineProperty(obj1, 'name', {
    value: '殷国亮',
    writable: false,
    enumerable: false,
  });

  obj1.name = '国亮';

  console.log(obj1);
</script>
